import axios, { baseURL } from '@/utils/request'

export function getPictureList (params) {
  return axios({
    method: 'get',
    url: '/mp/v1_0/user/images',
    params
  })
}

// 收藏素材
export function collectPicture (id, collect) {
  return axios({
    method: 'PUT',
    url: '/mp/v1_0/user/images/' + id,
    data: {
      collect
    }
  })
}

// 删除素材
export function delPicture (id) {
  return axios({
    method: 'DELETE',
    url: '/mp/v1_0/user/images/' + id
  })
}

// 图片上传的地址
export const uploadUrl = baseURL + 'mp/v1_0/user/images'

// 上传图片的接口
export function uploadPicture (fd) {
  return axios({
    method: 'POST',
    url: '/mp/v1_0/user/images',
    data: fd
  })
}
